from pms.common.views import PostFormula
from department.models import Department


class API(PostFormula):

    def handle(self, req):
        return self.success_respond({
            'list': [{
                'id': department.id,
                'name': department.name
            } for department in Department.objects.all()]
        })
